<?php

declare(strict_types=1);

namespace App\Model\Admin;

use App\Traits\Model\Admin\Permission as PermissionTraits;
use App\Model\Model;

/**
 * @property int $id 
 * @property string $name 权限名称
 * @property int $menu_id 菜单ID
 * @property string $path 权限路径
 * @property string $link 前端路由
 * @property int $status 状态|["禁用","启用"]
 * @property string $method 请求方式
 * @property string $version 版本
 * @property \Carbon\Carbon $created_at
 * @property \Carbon\Carbon $updated_at 
 */
class Permission extends Model
{
    use PermissionTraits;

    /**
     * The table associated with the model.
     */
    protected ?string $table = 'permission';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'name', 'menu_id', 'path', 'link', 'status', 'method', 'version', 'created_at', 'updated_at'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'menu_id' => 'integer', 'status' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];

    /**
     * 模块名称
     * @var string
     */
    protected string $modularName = '权限管理';

    /**
     * @var array|string[]
     */
    protected array $appends = ['is_check'];
}
